using System;

namespace DreamDriven.ObjectModel.Exceptions
{
    /// <summary>
    /// Data object paramitrized exception
    /// </summary>
    /// <typeparam name="TDataObject">The type of the data object.</typeparam>
    public class DataObjectException<TDataObject> : Exception
        where TDataObject: IDataObject
    {
        /// <summary>
        /// Gets or sets the data object.
        /// </summary>
        /// <value>The data object.</value>
        public TDataObject DataObject { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="DataObjectException&lt;TDataObject&gt;"/> class.
        /// </summary>
        /// <param name="dataObject">The data object.</param>
        public DataObjectException(TDataObject dataObject)
        {
            DataObject = dataObject;
        }
    }
}